package node.exp;

import grammar.Lexer;
import node.Node;
import symbol.SymbolTable;

public class Cond implements Node {
    private final Lexer lexer;
    private final SymbolTable table;
    private Node father;
    private LOrExp lOrExp;

    public Cond(Lexer lexer, SymbolTable table) {
        this.lexer = lexer;
        this.table = table;
        parseCond();
    }

    private void parseCond() {
        lOrExp = new LOrExp(lexer, table, this);
    }

    public void setFather(Node father) {
        this.father = father;
    }

    public int getLAndNum() {
        return lOrExp.getLAndNum();
    }

    @Override
    public Node getFather() {
        return father;
    }

    @Override
    public String toString() {
        return lOrExp.toString() + "<Cond>\n";
    }

    @Override
    public String genMidCode() {
        lOrExp.genMidCode();
        return "";
    }
}

